package com.indexingsystem.boss.admin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.indexingsystem.boss.Vo.PavilionColumnsSortVo;
import com.indexingsystem.boss.Vo.PavilionSortVo;
import com.indexingsystem.boss.Vo.PavilionsQueryVo;
import com.indexingsystem.boss.entity.PavilionColumns;
import com.indexingsystem.boss.entity.PavilionMenuRelations;
import com.indexingsystem.boss.entity.Pavilions;

@Repository
public interface PavilionsMapper {
	
	Pavilions selectPavilionName(String name);
	
	List<Pavilions> selectPavilionsList(PavilionsQueryVo pavilionsQueryVo);

	Integer getPavilionsListCount(PavilionsQueryVo pavilionsQueryVo);
	
	Pavilions selectPavilionsByPrimaryKey(String pavilionId);
	
	List<PavilionMenuRelations> selectPavilionMenuRelationsByPrimaryKey(String pavilionId);
	
	int deletePavilionMenuRelations(@Param("list") List<String> list);
	
	int insertPavilionMenuRelations(@Param("list") List<PavilionMenuRelations> list);
	
	int updatePavilions(Pavilions pavilions);
	
	int insertPavilions(Pavilions pavilions);
	
	int deletePavilions(@Param("list") List<String> ids);
	
	
	/**
	 * 通过id删除单个分馆信息.
	 * @param pavilionId
	 * @return
	 */
	int deletePavilionsById(String pavilionId);
	
	
    /**
     * 通过分馆idlist 查询 所有排序值列表.
     * 
     * @param ids
     * @return
     */  
    List<String> getPavilionsListByIds(@Param("list")  List<String> list);
	
	
	/**
	 * 获取分馆排序最大值.
	 * @return
	 */
    String getParentColumnOrderSortMax();
    
    /**
     * 通过排序获取分馆信息.
     * @param columnOrder
     * @return
     */
    Pavilions getPavilionByColumnOrder(String columnOrder);
    
    /**
     * 批量修改分馆上移、下移操作.
     * @param list
     * @return
     * @throws Exception
     */
     int updateBatchPavilions(@Param("list") List<Pavilions> list) throws Exception;
     
     
     /**
      * 通过排序获取分馆列表.
      * @param columnOrder
      * @return
      */
     List<Pavilions> getPavilionsListByColumnOrder(String columnOrder);
     
     List<Pavilions> getPavilionListByCondition(PavilionSortVo pavilionSortVo);

 	void updatePavilionListByCondition(PavilionSortVo pavilionSortVo);
}